home *** CD-ROM | disk | FTP | other *** search
/ Scene Storm / Scene Storm - Volume 1.iso / coding / c / amiexpress / source / ae / code / ax3.00 / menusend24.c < prev    next >
Encoding:
C/C++ Source or Header  |  1980-01-03  |  1.5 KB  |  76 lines

  1. #include "bbs.h"
  2.  
  3. int MenuSend24(char *s,int startcount)
  4. {
  5. FILE *fp;
  6. int stat;
  7. BOOL checked=FALSE;
  8. char c[1000]; /**** old char c[256]; ****/
  9. stat=Restricted(s);
  10. LineCount=startcount;
  11. fp=fopen(s,"r");
  12. if(fp==NULL || stat)
  13.     {
  14.     sprintf(c,"File %s Unavailable\r\n",s);
  15.     AEPutStr(c);
  16.     return(FAILURE);
  17.     }
  18. ConPutStr(" p"); /* turn console cursor off */
  19.  
  20. while(fgets(c,995,fp)!=NULL)
  21.     {
  22.         {
  23.         c[996]='\0'; /**** old c[251]='\0'; ****/
  24.           if(c[0]=='~' && !checked) { fclose(fp); return(mcisend(s)); }
  25.           checked=TRUE;
  26.         if(c[strlen(c)-1]=='\n')
  27.             {
  28.             strcat(c,"\r");
  29.             AEPutStr(c);
  30.             if(stat=CheckForPause())
  31.                 {
  32.                 AEPutStr("\r\n");
  33.                 fclose(fp);
  34.                     ConPutStr(" p");  /* turn console cursor back on */
  35.  
  36.                 return(stat);
  37.                 }
  38.             }
  39.         else
  40.             {
  41.             AEPutStr(c);
  42.             }
  43.         /* CHECK FOR INPUT && CARRIER */
  44.         if(SCheckInput())
  45.             {
  46.             stat=ReadChar(1L);
  47.             if(stat<0) { fclose(fp);
  48.                ConPutStr(" p");  /* turn console cursor back on */
  49.                return(stat); }
  50.             switch(stat)
  51.                 {
  52.                 case '\023': /* Pause */
  53.                     stat=ReadChar(KEYBOARD_TIMEOUT);
  54.                     if(stat<0)
  55.                         {
  56.                         fclose(fp);
  57.                               ConPutStr(" p");  /* turn console cursor back on */
  58.  
  59.                         return(NO_CARRIER);
  60.                         }
  61.                     break;
  62.                 case '\003': /* ^C */
  63.                     AEPutStr("**Break\r\n\r\n");
  64.                          fclose(fp); if(AnsiColor)  AEPutStr("");return(SUCCESS);
  65.                     break;
  66.                 }
  67.             }
  68.         }
  69.     }
  70. MenuMark1:
  71. fclose(fp);
  72. ConPutStr(" p");  /* turn console cursor back on */
  73.  
  74. AEPutStr("\r\n");
  75. return(SUCCESS);
  76. }